<!--Copyright (C) Kherty.  All rights reserved.-->
<ResourceDictionary
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    x:Class="OpenLS.Chart.UI.ValueAxis3DResources"
    xmlns:chart="http://schemas.Kherty.com/office/2007/chart"
    xmlns:chartui="clr-namespace:OpenLS.Chart.UI"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Internals="clr-namespace:OpenLS.Chart.UI.Internals"
    xmlns:drawingui="clr-namespace:OpenLS.Drawing.UI;assembly=OpenLS.Drawing.UI"
>
    <ResourceDictionary.MergedDictionaries>
        <chartui:ChartLine3DResources/>
    </ResourceDictionary.MergedDictionaries>
    <Style x:Key="VerticalNumericValueContainerStyle">
        <Setter Property="Internals:CameraPanel.Y" Value="{Binding Path=Value}"/>
        <Setter Property="FrameworkElement.VerticalAlignment" Value="Center"/>
        <Setter Property="FrameworkElement.HorizontalAlignment" Value="Left"/>
    </Style>
    <Style x:Key="HorizontalNumericValueContainerStyle">
        <Setter Property="Internals:CameraPanel.X" Value="{Binding Path=Value}"/>
        <Setter Property="FrameworkElement.VerticalAlignment" Value="Bottom"/>
        <Setter Property="FrameworkElement.HorizontalAlignment" Value="Center"/>
    </Style>

    <DataTemplate DataType="{x:Type chart:NumericValue}" x:Key="NumericValueLabelTemplate">
        <TextBlock Margin="3 0 6 0" Name="tb" Style="{x:Static chartui:NumericValueResources.NumericValueLabelStyle}">
        </TextBlock>
    </DataTemplate>
    <DataTemplate DataType="{x:Type chart:NumericValue}" x:Key="NumericValueTickTemplate">
        <Line Stroke="Black" StrokeThickness="1" Name="l" />
        <DataTemplate.Triggers>

            <DataTrigger Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="{x:Static chart:AxisPosition.Right}">
                <Setter TargetName="l" Property="HorizontalAlignment" Value="Left"/>
            </DataTrigger>
            <DataTrigger Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="{x:Static chart:AxisPosition.Left}">
                <Setter TargetName="l" Property="HorizontalAlignment" Value="Right"/>
            </DataTrigger>
            <DataTrigger Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="{x:Static chart:AxisPosition.Top}">
                <Setter TargetName="l" Property="VerticalAlignment" Value="Bottom"/>
            </DataTrigger>
            <DataTrigger Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="{x:Static chart:AxisPosition.Bottom}">
                <Setter TargetName="l" Property="VerticalAlignment" Value="Top"/>
            </DataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="Bottom"/>
                    <Condition Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.TickMark)}" Value="{x:Static chart:TickMark.Cross}"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Y2" TargetName="l"  Value="6"/>
                <Setter  TargetName="l" Property="Margin" Value="0 -3 0 0"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="Bottom"/>
                    <Condition Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.TickMark)}" Value="{x:Static chart:TickMark.Inside}"/>
                </MultiDataTrigger.Conditions>
                <Setter  TargetName="l" Property="Y2" Value="3"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="Bottom"/>
                    <Condition Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.TickMark)}" Value="{x:Static chart:TickMark.Outside}"/>
                </MultiDataTrigger.Conditions>
                <Setter  TargetName="l" Property="Y2" Value="3"/>
                <Setter  TargetName="l" Property="Margin" Value="0 -3 0 0"/>
            </MultiDataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="Top"/>
                    <Condition Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.TickMark)}" Value="{x:Static chart:TickMark.Cross}"/>
                </MultiDataTrigger.Conditions>
                <Setter TargetName="l" Property="Y2" Value="6"/>
                <Setter TargetName="l" Property="Margin" Value="0 0 0 -3"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="Top"/>
                    <Condition Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.TickMark)}" Value="{x:Static chart:TickMark.Outside}"/>
                </MultiDataTrigger.Conditions>
                <Setter TargetName="l" Property="Y2" Value="3"/>
                <Setter TargetName="l" Property="Margin" Value="0 0 0 -3"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="Top"/>
                    <Condition Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.TickMark)}" Value="{x:Static chart:TickMark.Inside}"/>
                </MultiDataTrigger.Conditions>
                <Setter TargetName="l" Property="Y2" Value="3"/>
            </MultiDataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="Left"/>
                    <Condition Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.TickMark)}" Value="{x:Static chart:TickMark.Cross}"/>
                </MultiDataTrigger.Conditions>
                <Setter TargetName="l" Property="X2" Value="6"/>
                <Setter TargetName="l" Property="Margin" Value="0 0 -3 0"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="Left"/>
                    <Condition Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.TickMark)}" Value="{x:Static chart:TickMark.Outside}"/>
                </MultiDataTrigger.Conditions>
                <Setter TargetName="l" Property="X2" Value="3"/>
                <Setter TargetName="l" Property="Margin" Value="0 0 -3 0"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="Left"/>
                    <Condition Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.TickMark)}" Value="{x:Static chart:TickMark.Inside}"/>
                </MultiDataTrigger.Conditions>
                <Setter  TargetName="l" Property="X2" Value="3"/>
            </MultiDataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="Right"/>
                    <Condition Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.TickMark)}" Value="{x:Static chart:TickMark.Cross}"/>
                </MultiDataTrigger.Conditions>
                <Setter TargetName="l" Property="X2" Value="6"/>
                <Setter TargetName="l" Property="Margin" Value="-3 0 0 0"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="Right"/>
                    <Condition Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.TickMark)}" Value="{x:Static chart:TickMark.Outside}"/>
                </MultiDataTrigger.Conditions>
                <Setter TargetName="l" Property="X2" Value="3"/>
                <Setter TargetName="l" Property="Margin" Value="-3 0 0 0"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=l, Path=(chartui:AxisElement.AxisPosition)}" Value="Right"/>
                    <Condition Binding ="{Binding ElementName=l, Path=(chartui:AxisElement.TickMark)}" Value="{x:Static chart:TickMark.Inside}"/>
                </MultiDataTrigger.Conditions>
                <Setter TargetName="l" Property="X2" Value="3"/>
            </MultiDataTrigger>

        </DataTemplate.Triggers>
    </DataTemplate>

    <DataTemplate DataType="{x:Type chart:ValueAxis}" x:Key="ValueAxis3DTemplate">
        <Grid Style="{x:Static chartui:ChartHelperResources.FocusableByClickStyle}"
                  chartui:AxisElement.Axis="{Binding}"
                  >
            <chartui:AxisElement.MajorStep>
                <MultiBinding Converter="{x:Static Internals:ChartConverters.MinMaxToMajorStepConverter}">
                    <Binding RelativeSource="{RelativeSource Self}" Path="(chartui:AxisElement.Minimum)"/>
                    <Binding RelativeSource="{RelativeSource Self}" Path="(chartui:AxisElement.Maximum)"/>
                </MultiBinding>
            </chartui:AxisElement.MajorStep>

            <Grid.CommandBindings>
                <CommandBinding Command="{x:Static ApplicationCommands.Delete}" Executed="OnDelete"/>
                <CommandBinding Command="{x:Static chartui:ChartCommands.FormatAxis}" Executed="OnFormatAxis"/>
                <CommandBinding Command="{x:Static chartui:ChartCommands.AddMajorGridLines}" Executed="OnAddMajorGridLines" CanExecute="OnCanAddMajorGridLines"/>
                <CommandBinding Command="{x:Static chartui:ChartCommands.AddMinorGridLines}" Executed="OnAddMinorGridLines" CanExecute="OnCanAddMinorGridLines"/>
                <CommandBinding Command="{x:Static chartui:ChartCommands.FormatMajorGridLines}" Executed="OnFormatMajorGridLines" CanExecute="OnCanFormatMajorGridLines"/>
                <CommandBinding Command="{x:Static chartui:ChartCommands.FormatMinorGridLines}" Executed="OnFormatMinorGridLines" CanExecute="OnCanFormatMinorGridLines"/>

            </Grid.CommandBindings>
            <Grid.ContextMenu>
                <ContextMenu>
                    <MenuItem Command="{x:Static ApplicationCommands.Delete}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path= (chartui:AxisElement.Axis)}"/>
                    <Separator/>
                    <MenuItem Command="{x:Static chartui:ChartCommands.AddMajorGridLines}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path= (chartui:AxisElement.Axis)}"/>
                    <MenuItem Command="{x:Static chartui:ChartCommands.AddMinorGridLines}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path= (chartui:AxisElement.Axis)}"/>
                    <MenuItem Command="{x:Static chartui:ChartCommands.FormatMajorGridLines}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path= (chartui:AxisElement.Axis)}"/>
                    <MenuItem Command="{x:Static chartui:ChartCommands.FormatMinorGridLines}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path= (chartui:AxisElement.Axis)}"/>
                    <MenuItem Command="{x:Static chartui:ChartCommands.FormatAxis}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path= (chartui:AxisElement.Axis)}"/>
                </ContextMenu>
            </Grid.ContextMenu>
            <ItemsControl  Name="labels"
                          ItemTemplate="{x:Static chartui:ValueAxis3DResources.NumericValueLabelTemplate}"
                          ItemContainerStyle="{x:Static chartui:ValueAxis3DResources.VerticalNumericValueContainerStyle}"
                          
                          FontFamily="{Binding Path=TextProperties.Paragraphs[0].TextParagraphProperties.DpfRPr.Latin}"
                          >
                <ItemsControl.ItemsSource>
                    <MultiBinding  Converter="{x:Static Internals:ChartConverters.MinMaxToValuesConverter}">
                        <Binding RelativeSource="{RelativeSource Self}" Path="(chartui:AxisElement.Minimum)"/>
                        <Binding RelativeSource="{RelativeSource Self}" Path="(chartui:AxisElement.Maximum)"/>
                        <Binding RelativeSource="{RelativeSource Self}" Path="(chartui:AxisElement.MajorStep)"/>
                    </MultiBinding>
                </ItemsControl.ItemsSource>
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <Internals:CameraPanel Projector="{Binding  RelativeSource ={RelativeSource Self}, Path=(chartui:Chart3DElement.Projector)}"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>

            </ItemsControl>
            <ItemsControl Name="ticks"
                          ItemTemplate="{x:Static chartui:ValueAxis3DResources.NumericValueTickTemplate}"
                          ItemContainerStyle="{x:Static chartui:ValueAxis3DResources.VerticalNumericValueContainerStyle}">
                <ItemsControl.ItemsSource>
                    <MultiBinding Converter="{x:Static Internals:ChartConverters.MinMaxToValuesConverter}">
                        <Binding RelativeSource="{RelativeSource Self}" Path="(chartui:AxisElement.Minimum)"/>
                        <Binding RelativeSource="{RelativeSource Self}" Path="(chartui:AxisElement.Maximum)"/>
                        <Binding RelativeSource="{RelativeSource Self}" Path="(chartui:AxisElement.MajorStep)"/>
                    </MultiBinding>
                </ItemsControl.ItemsSource>

                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <Internals:CameraPanel Projector="{Binding RelativeSource={RelativeSource Self}, Path=(chartui:Chart3DElement.Projector)}"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>

            </ItemsControl>
        </Grid>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Position}" Value="{x:Static chart:AxisPosition.Bottom}">
                <Setter TargetName="labels" Property="ItemContainerStyle" Value="{x:Static chartui:ValueAxis3DResources.HorizontalNumericValueContainerStyle}"/>
                <Setter TargetName="ticks" Property="ItemContainerStyle" Value="{x:Static chartui:ValueAxis3DResources.HorizontalNumericValueContainerStyle}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Position}" Value="{x:Static chart:AxisPosition.Top}">
                <Setter TargetName="labels" Property="ItemContainerStyle" Value="{x:Static chartui:ValueAxis3DResources.HorizontalNumericValueContainerStyle}"/>
                <Setter TargetName="ticks" Property="ItemContainerStyle" Value="{x:Static chartui:ValueAxis3DResources.HorizontalNumericValueContainerStyle}"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>


</ResourceDictionary>